package cn.imnaer.service.rest.view.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import cn.imnaer.service.persistence.model.SharePhoto;
import cn.imnaer.service.persistence.model.TribalMessage;

/**
 * 分享相册 (用于个人相册, 始于推荐)
 * Created by Administrator on 2015/5/6.
 */
public class SharePhotoResponse implements Serializable {

    /**
     * 用户Id
     */
    private String userId;

	private  boolean  isShare;
    /**
     * 用户名
     */
    private String userName;
    /**
     * 分享相册ID
     */
    private String sharePhotoId;
    /**
     * 分享相册名
     */
    private String sharePhotoName;
    /**
     * 是否收藏
     */
    private boolean isCollected;
    /**
     * 评分
     */
    private String score;
    /**
     * 支持(赞)人数
     */
    private int supportCount = 0;
    /**
     * 评论人数
     */
    private int commentCount = 0;

    private List<TribalMessage> tribalMessages = new ArrayList<>();

    /**
     * 创建时间
     */
    private Long createTime;
    /**
     * 相册类型 (吃, 住, 玩)
     */
    private String type;
    /**
     * 地点类型 (国家, 省, 市, 景点)
     */
    private String placeType;
    /**
     * 地点ID 跟地点类型捆绑, 是一个多元化的ID
     */
    private String placeId;
    /**
     * 地点名称
     */
    private String placeName;
    /**
     * 相片Item集合
     */
    private List<SharePhotoItemResponse> items = new ArrayList<SharePhotoItemResponse>();
    public boolean getIsShare() {
		return isShare;
	}

	public void setIsShare(boolean isShare) {
		this.isShare = isShare;
	}


    public SharePhotoResponse parse(SharePhoto target) {
    	this.isShare=target.getIsShare();
        this.sharePhotoId = target.getSharePhotoId();
        this.userId = target.getUserId();
        this.userName = target.getUserName();
        this.sharePhotoName = target.getSharePhotoName();
        this.score = target.getScore();
        this.createTime = target.getCreateTime();
        this.type = target.getType();
        this.placeId = target.getPlaceId();
        this.placeName = target.getPlaceName();
        this.placeType = target.getPlaceType();
        this.items = SharePhotoItemResponse.parseList(target.getItems());
        this.tribalMessages = target.getTribalMessages();
        return this;
    }

    public static List<SharePhotoResponse> parseList(List<SharePhoto> targetList) {
        List<SharePhotoResponse> result = new ArrayList<>();
        for (SharePhoto item : targetList) {
            result.add(new SharePhotoResponse().parse(item));
        }
        return result;
    }

    /**
     * *****************************************************************************************************************************************
     */

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getSharePhotoId() {
        return sharePhotoId;
    }

    public void setSharePhotoId(String sharePhotoId) {
        this.sharePhotoId = sharePhotoId;
    }

    public String getSharePhotoName() {
        return sharePhotoName;
    }

    public void setSharePhotoName(String sharePhotoName) {
        this.sharePhotoName = sharePhotoName;
    }

    public boolean getIsCollected() {
        return isCollected;
    }

    public void setIsCollected(boolean isCollected) {
        this.isCollected = isCollected;
    }

    public String getScore() {
        return score;
    }

    public void setScore(String score) {
        this.score = score;
    }

    public int getSupportCount() {
        return supportCount;
    }

    public void setSupportCount(int supportCount) {
        this.supportCount = supportCount;
    }

    public int getCommentCount() {
        return commentCount;
    }

    public void setCommentCount(int commentCount) {
        this.commentCount = commentCount;
    }

    public Long getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Long createTime) {
        this.createTime = createTime;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getPlaceType() {
        return placeType;
    }

    public void setPlaceType(String placeType) {
        this.placeType = placeType;
    }

    public String getPlaceId() {
        return placeId;
    }

    public void setPlaceId(String placeId) {
        this.placeId = placeId;
    }

    public String getPlaceName() {
        return placeName;
    }

    public void setPlaceName(String placeName) {
        this.placeName = placeName;
    }

    public List<SharePhotoItemResponse> getItems() {
        return items;
    }

    public void setItems(List<SharePhotoItemResponse> items) {
        this.items = items;
    }

    public List<TribalMessage> getTribalMessages() {
        return tribalMessages;
    }

    public void setTribalMessages(List<TribalMessage> tribalMessages) {
        this.tribalMessages = tribalMessages;
    }
}
